package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 何华树
 * Date: 2024-09-04
 * Time: 13:07
 */

public class Test {
    public static void func_eat(Animal animal) {
        animal.eat();
    }
    public static void func_swim(Iswimming iswimming) {
        iswimming.swim();
    }
    public static void func_run(Irunning irunning) {
        irunning.run();
    }
    public static void func_fly(Ifly ifly) {
        ifly.fly();
    }
    public static void main(String[] args) {
        Dog dog = new Dog("旺财",10);
        func_eat(dog);
        func_run(dog);
        func_swim(dog);
        Bird bird = new Bird("彩金",10);
        func_eat(bird);
        func_fly(bird);
        Cat cat = new Cat("小虎",10);
        func_eat(cat);
        func_run(cat);
        func_swim(cat);
    }
}
